package com.o2o.cleaning.month.platform.ebusiness_plat

import org.apache.spark.sql.SparkSession

object HoloConn {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder()
      .master("local[*]")
      .appName("ReadHolo")
      .config("spark.debug.maxToStringFields", "500")
      .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
      .config("spark.executor.heartbeatInterval", "120s")
      .config("spark.network.timeout", "12000s")
      .getOrCreate()

    val shoptab = spark.read.format("jdbc")
      .option("url", "jdbc:postgresql://hgprecn-cn-m7r1xxicx002-cn-beijing.hologres.aliyuncs.com:80/pdb")
      .option("user", "LTAI4Fzm6tCPCiAutd9tXicj")
      .option("driver", "org.postgresql.Driver")
      .option("password", "IPiUVIlP1arYKBX3hETT0MdSkE4qeQ")
      .option("dbtable",
        s"""
           |dim_data.dim_standard_enterprise
           |""".stripMargin)
      .option("partitionColumn", "id")
      .option("numPartitions", "8")
      .option("lowerBound", "0")
      .option("upperBound", "1200000")
      .option("fetchsize", "10000")
      .load().show()


  }
}
